package com.example.excel;


import javax.imageio.stream.FileImageOutputStream;
import java.io.File;
import java.text.SimpleDateFormat;
import java.util.Date;

public class Test {
    public static void main(String[] args) {
        SimpleDateFormat sdf = new SimpleDateFormat("yyyy年MM月dd日");
        String date = sdf.format(new Date());
        try {
            byte[] pic = DateTes.picture(date);
            FileImageOutputStream imageOutput = new FileImageOutputStream(new File("C:\\Users\\admin\\Desktop\\1.png"));//打开输入流
            imageOutput.write(pic, 0, pic.length);//将byte写入硬盘
            imageOutput.close();
        } catch (Exception e) {
            throw new RuntimeException(e);
        }
    }
}
